package com.jrauto.CarAppBackend.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.Objects;

/**
 * 汽车车系表
 * @TableName series
 */
@TableName(value ="series")
@Data
public class Series {
    /**
     * 车系ID
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 所属品牌ID
     */
    private String brand;

    /**
     * 车系中文名
     */
    private String name;

    /**
     * 车系英文名
     */
    private String english;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getEnglish() {
        return english;
    }

    public void setEnglish(String english) {
        this.english = english;
    }

    public Series() {
    }

    public Series(Integer id, String brand, String name, String english) {
        this.id = id;
        this.brand = brand;
        this.name = name;
        this.english = english;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Series series = (Series) o;
        return Objects.equals(id, series.id) && Objects.equals(brand, series.brand) && Objects.equals(name, series.name) && Objects.equals(english, series.english);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, brand, name, english);
    }

    @Override
    public String toString() {
        return "Series{" +
                "id=" + id +
                ", brand='" + brand + '\'' +
                ", name='" + name + '\'' +
                ", english='" + english + '\'' +
                '}';
    }
}